export function genAside(pages) {
  return pages
    .filter((page) => {
      if (page.chapter) return true
    })
    .map((page) => {
      return {
        text: page.chapter,
        items: page.articles.map((article) => {
          return {
            text: article.title.match(/^[A-Z]\d+-00 (.*?)-/)
              ? article.title.match(/^[A-Z]\d+-\d+ (.*?-.*?)$/)[1]
              : article.title.match(/^[A-Z]\d+-\d+ .*?-(.*?)$/)[1],
            link: article.url
          }
        })
      }
    })
}
